package org.example.twodemo;

import java.util.Arrays;

public class Array {
    public static void main(String[] args) {
        int [] array = new int [ 10 ];
        int[] array1 = {0,1,2,3,4,5,6,7,8,9};
        int [] array2 ;
        array2= new int []{ 10 , 20 , 30 };
        //访问数组
        System.out.println(array1[3]);
        //遍历数组
        for (int i = 0; i < array2.length; i++) {
            System.out.print(array2[i]+" ");
        }
        //用字符串类型接受方法的返回值
        String arrays = Arrays.toString(array1);
        System.out.println(arrays);
        //二维数组的定义
        int[][] array3 = {{1,2,3},{4,5,6}};
        int[][] array4 = new int[2][3];
        int[][] array5 = new int[][]{{1,2,3},{4,5,6}};
    }
}
